/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package main.Memory;

import com.jme3.audio.AudioNode;
import com.jme3.scene.Node;
import java.util.HashMap;
import main.Main;

/**
 *
 * @author usuario
 */
public class Sound {
    
    private static HashMap<String, AudioNode> sounds = new HashMap<String, AudioNode>();
    
    private static void addSound(String name, AudioNode sound) {
        sounds.put(name, sound);
        Main.getHandler().getRootNode().attachChild(sound);
    }
    
    public static void playSound(String name) {
        if(sounds.containsKey(name))
            sounds.get(name).playInstance();
    }
    
    public static void loadSounds() {
        AudioNode axe = new AudioNode(Main.getHandler().getAssetManager(), "Sounds/SE/axe.wav",false);
        addSound("axe",axe);
    }
    
    
}
